﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PluralSightTut
{
    class Area
    {
        public int ID { get; set; }
        public string Name { get; set; }

        public virtual void PrintArea(int id)
        {
            Console.WriteLine("Area name : {0}", Name);
        }

        public static List<Area> GetArea()
        {
            List<Area> Areas = new List<Area>();
            for (int i = 0; i < 2; i++)
            {
                Areas.Add(new Area
                {
                    ID = i + 1,
                    Name = "Area" + i
                });
            }
            return Areas;
        }

        public Area()
        {

        }

        public Area(int ID)
        {
            this.ID = ID;
        }
    }

    class Building : Area
    {
        public int BuildingID { get; set; }
        public int RoadID { get; set; }
        public override void PrintArea(int id)
        {
            base.PrintArea(id);
            Console.WriteLine("Road : {0}", RoadID);
        }
    }

    class Appartment : Building
    {
        public string AppartmentName { get; set; }
        public override void PrintArea(int id)
        {
            base.PrintArea(id);
            Console.WriteLine("Appartment Name : {0}",AppartmentName);
        }

        public static Appartment GetApt()
        {
            return new Appartment
            {
                ID = 101,
                Name = "HH",
                BuildingID = 202,
                RoadID = 303,
                AppartmentName = "SSS"
            };
        }
    }
}
